﻿
Partial Class Public_ManageContactInfo
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Me.BindGV()
        End If
    End Sub
    Private Sub BindGV()
        Dim sql As New MyStringBuilder
        Dim dat As New clsData

        sql.Length = 0
        sql.AppendFormat("select o.OrganizationName,e.EmployeeName,e.PhoneNumber, ")
        sql.AppendFormat("e.FaxPhoneNumber,e.Email from Employee e ")
        sql.AppendFormat("inner join Organization o on e.OrganizationID=o.OrganizationID ")
        sql.AppendFormat("where e.IsAdmin='Y' ")
        sql.AppendFormat("union ")
        sql.AppendFormat("select v.VOrganizationName,p.PersonName,p.PhoneNumber, ")
        sql.AppendFormat("p.FaxPhoneNumber,p.Email from person p ")
        sql.AppendFormat("inner join VOrganization v on p.VOrganizationID=v.VOrganizationID ")
        sql.AppendFormat("where p.IsAdmin='Y' ")


        gv.DataSource = dat.GetData(sql)
        gv.DataBind()
    End Sub

    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
        If clsAuth.GetUserID() <> "" Then
            Me.MasterPageFile = "~\WebForm\MasterPage.master"
        End If
    End Sub

    'Public Shared Function GetFilePath(ByVal fileGroupID As String, Optional ByVal IncludeFileFormat As Boolean = False) As String
    '    Dim dat As New clsData
    '    Dim sql As New MyStringBuilder

    '    sql.AppendFormat("select fg.* from FileGroup fg ")
    '    sql.AppendFormat("where FileGroupID = '{0}' ", fileGroupID)

    '    Dim dt As Data.DataTable = dat.GetData(sql)

    '    If IncludeFileFormat = True Then
    '        Return dt.Rows(0)("FilePath") + dt.Rows(0)("FileFormat")
    '    Else
    '        Return dt.Rows(0)("FilePath")
    '    End If
    'End Function

    'Protected Sub gv_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gv.PageIndexChanging
    '    Me.gv.PageIndex = e.NewPageIndex
    '    Me.BindGV()
    'End Sub
End Class
